# 此为建表文件，如果没有在test的库上建表，就运行此文件。
import pymysql


db = pymysql.connect("localhost","debian-sys-maint","ctysTk7upM0cm2sV","test_1", charset='utf8')  # 使用test库作为缓存信息载体
cursor = db.cursor()
sql = "CREATE TABLE user (id INT NOT NULL AUTO_INCREMENT,username  VARCHAR(40) NOT NULL," \
      "password VARCHAR(40) NOT NULL,nickname VARCHAR(100) NOT NULL,secret_problem VARCHAR(200) NOT NULL," \
      "secret_answer VARCHAR(200) NOT NULL,PRIMARY KEY(id))character set utf8;"   # MYSQL命令语句 建表
cursor.execute(sql)
db.close()